import { PenEventProps } from "@/types";
import { FormRowCol } from "@/components/common/FormRowCol.tsx";
import { Input, Space } from "antd";

export function EventExecuteGlobalFn(props: PenEventProps) {
  return (
    <Space style={{ padding: "0" }} className={"w-full"} direction="vertical">
      <FormRowCol label={"函数名称"}>
        <Input
          value={typeof props.item.value == "string" ? props.item.value : ""}
          onChange={(e) => {
            props.onChange("value", e.target.value, props.index);
          }}
        />
      </FormRowCol>
      <FormRowCol label={"函数参数"}>
        <Input
          value={props.item.params}
          onChange={(e) => {
            props.onChange("params", e.target.value, props.index);
          }}
        />
      </FormRowCol>
    </Space>
  );
}
